package JUnit;


import java.io.File;

import Control.Factory;
import Control.ICommandExecutor;
import junit.framework.TestCase;

public class FactoryTest extends TestCase {
    
	public FactoryTest(String testName)
	{
		super(testName);
    }
	
	Factory factory = new Factory();
	
	public void copyTest() {                  
		String command="copy G:\\ 1.txt G:\\ii";
        ICommandExecutor copyExecutor = factory.getCommandExecuterexecute(command);
        copyExecutor.execute(command);
        boolean result = new File("G:\\ii/1.txt").exists();
        assertTrue(result);
	}
	public void mkDirTest()
	{
		String command="mkdir G:\\ folder";
        ICommandExecutor copyExecutor = factory.getCommandExecuterexecute(command);
        copyExecutor.execute(command);
        boolean result = ((new File("G:\\folder").exists()) && (new File("G:\\folder").isDirectory()));
        assertTrue(result);
	}
}
